#include "ItemGroup.h"
#include "Defines.h"



ItemGroup::ItemGroup(QObject *parent)
    : AbstractItem(ItemCategory_Group, parent)
{
}



ItemGroup::ItemGroup(const QString& name, QObject *parent) :
    AbstractItem(ItemCategory_Group, parent)
{
    setData(NameData, name);
}



int ItemGroup::fieldCount() const
{
    int ret = (AbstractItem::DataType_LAST - AbstractItem::DataType_FIRST + 1);
    foreach (const AbstractItem* item, findChildren<AbstractItem*>())
    {
        int fields = item->fieldCount();
        if (fields <= ret) continue;

        ret = fields;
    }

    return ret;
}



void ItemGroup::setCustomData(const int &, const QVariant &)
{
}


QVariant ItemGroup::customData(const int &) const
{
    return QVariant();
}
